﻿using wwl.Contract.Dtos.Common;
using wwl.Contract.Dtos.Requests.Rbac;
using wwl.Contract.Dtos.Responses.Rbac;

namespace wwl.Contract.Interfaces.Rbac
{
  /// <summary>
  /// 用户领域服务接口
  /// 定义用户相关的核心业务操作规范，封装用户领域的完整业务流程
  /// </summary>
  public interface IUserService
  {
    /// <summary>
    /// 根据ID查询用户详情
    /// </summary>
    Task<UserResponse?> GetByIdAsync(string id);

    /// <summary>
    /// 创建用户
    /// </summary>
    Task<UserResponse> CreateAsync(CreateUserRequest request, string createdBy);

    /// <summary>
    /// 更新用户信息
    /// </summary>
    Task<UserResponse> UpdateAsync(string id, UpdateUserRequest request);

    /// <summary>
    /// 删除用户（逻辑删除）
    /// </summary>
    Task<bool> DeleteAsync(string id);

    /// <summary>
    /// 分页查询用户列表
    /// </summary>
    Task<PagedResult<UserResponse>> GetPagedAsync(UserPagedRequest request);

    /// <summary>
    /// 用户登录认证
    /// </summary>
    Task<UserResponse?> AuthenticateAsync(string username, string password);

    /// <summary>
    /// 重置用户密码
    /// </summary>
    Task<bool> ResetPasswordAsync(string userId, string newPassword);

    /// <summary>
    /// 验证当前密码
    /// </summary>
    Task<bool> VerifyCurrentPasswordAsync(string userId, string currentPassword);
  }
}